<template>
  <u-form-grid :data="formGrid" ref=""></u-form-grid>
</template>

<script>
  import values from '../../utils/values'

  export default {
    name: 'Order',
    data () {
      return {
        formGrid: {
          exportParams: ["invoiceType", "orderNo", "startDate", "endDate"],
          options: {
            autoLoad: true,
            version: 'v2',
            url: {
              page: "orderInvoice/page"
            }
          },
          toolbar: {
            create: {
              show: false
            },
            delete: {
              show: false
            },
            groups: {
              show: true,
              export: {
                label: "导出全部",
                show: true,
                fileName: "订单发票数据",
                columns: [
                  {title: '订单编号', key: 'orderNo'},
                  {title: '车主名称', key: 'name'},
                  {title: '认证手机', key: 'mobileAudit'},
                  {title: 'VIN码', key: 'vin'},
                  {title: '省市区', key: 'areaFullName'},
                  {title: '详细地址', key: 'address'},
                  {title: '收件人姓名', key: 'consignee'},
                  {title: '收件人手机号', key: 'mobile'},
                  {title: '发票类型', key: 'invoiceType'},
                  {title: '发票抬头', key: 'titleName'},
                  {title: '税号', key: 'taxFileNumber'},
                  {title: '开票日期', key: 'makeDate'},
                  {title: '发票号', key: 'invoiceNo'},
                  {title: '快递公司', key: 'expressName'},
                  {title: '快递单号', key: 'expressNo'}
                ]
              }
            },
            //关键字搜索框
            filter: {
              show: false,
              name: "keyWord",
              placeholder: "根据订单编号或商品名称搜索"
            },
            superFilter: {
              show: true,
              label: "高级搜索",
              width: 500,
              columns: [
                {type: "text", label: "订单编号", name: "orderNo", icon: "plus", placeholder: "请填写订单编号"},
                {
                  type: "select",
                  label: "发票类型",
                  name: "invoiceType",
                  clearable: true,
                  filterable: false,
                  multiple: false,
                  data: [{
                    value: '个人',
                    name: '个人'
                  }, {
                    value: '公司',
                    name: '公司'
                  }
                  ]
                },
                {type: "daterange", label: "订单编号", icon: "plus", placeholder: "请选择时间"},

              ],
              submit: {theme: "success", label: "查询", icon: "plus"}
            }
          },
          tips: {title: "合同发票列表", content: "根据条件：订单号,VIN,发票类型,户名查询合同发票列表"},
          form: {
            modal: {
              title: "详情"
            },
            columns: [
              {label: "ID", type: "text", name: "id", required: false, disabled: true},
              {label: "订单编号", type: "text", name: "orderNo", required: false, disabled: true},
              {label: "VIN码", type: "text", name: "vin", required: false, disabled: true},
              {label: "客户名称", type: "text", name: "name", required: false, disabled: true},
              {label: "手机号", type: "text", name: "mobile", required: false, disabled: true},
              {label: "开户银行", type: "text", name: "depositBank", required: false, disabled: true},
              {label: "公司地址", type: "text", name: "companyAddress", required: false, disabled: true},
              {label: "账号", type: "text", name: "accountNo", required: false, disabled: true},
              {label: "税号", type: "text", name: "taxFileNumber", required: false, disabled: true},
              {label: "开票备注", type: "text", name: "remark", required: false, disabled: true},
              {label: "开票日期", type: "text", name: "makeDate", required: false, disabled: true},
              {label: "发票号", type: "text", name: "invoiceNo", required: false, disabled: true},
              {label: "快递公司", type: "text", name: "expressName", required: false, disabled: true},
              {label: "快递单号", type: "text", name: "expressNo", required: false, disabled: true}
            ]
          },
          table: {
            showCheckbox: false,
            operation: {
              primaryKey: "id",
              buttons: [{
                key: "view", show: true, "label": "详情", "theme": "text", click: (row, index, _this) => {
                  _this.optViewClick(row, index);
                }
              }, {
                key: "edit", show: false, "label": "编辑", "theme": "primary", click: (row, index, _this) => {
                  _this.optEditClick(row, index);
                }
              }, {
                key: "delete", show: false, "label": "删除", "theme": "error", click: (row, index, _this) => {
                  _this.optDeleteClick(row, index);
                }
              }]
            },
            columns: [
              {title: '订单编号', key: 'orderNo'},
              {title: '车主名称', key: 'name'},
              {title: '认证手机', key: 'mobileAudit'},
              {title: 'VIN码', key: 'vin'},
              {title: '省市区', key: 'areaFullName'},
              {title: '详细地址', key: 'address'},
              {title: '收件人姓名', key: 'consignee'},
              {title: '收件人手机号', key: 'mobile'},
              {title: '发票类型', key: 'invoiceType'},
              {title: '发票抬头', key: 'titleName'},
              {title: '税号', key: 'taxFileNumber'},
              {title: '开票日期', key: 'makeDate'},
              {title: '发票号', key: 'invoiceNo'},
              {title: '快递公司', key: 'expressName'},
              {title: '快递单号', key: 'expressNo'}
            ]
          }
        }
      }
    },
    methods: {}
  }

</script>
